package com.lepu.app.fun.health.bean;

import java.util.Arrays;
import java.util.List;

import org.json.JSONException;
import org.json.JSONObject;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

public class BeanDurgDetail {
   public String MedicineID;
   public String GenericName;
   public String ProductName;
   public String Packing;
   public String Usage;
   public String Indication;
   public String Producer;
   public String Price;
   public String Introduce;
   public String Remark;
   public String ImgUrl;
   public List<String> ImgUrls; // 图片集合
   
   public static BeanDurgDetail parseJsonData(String dataString) {
		String result = "";
		try {
			JSONObject jsonObject = new JSONObject(dataString);
			JSONObject obj1 = (JSONObject) jsonObject.get("Result");
			JSONObject obj2 = obj1.getJSONObject("DetailInfo");
			
			result = obj2.toString();
		} catch (JSONException e) {
			e.printStackTrace();
		}

		Gson gson = new Gson();
		BeanDurgDetail item = gson.fromJson(result,new TypeToken<BeanDurgDetail>() {}.getType());
		item.ImgUrls = (List<String>) Arrays.asList(item.ImgUrl.split("\\|"));
		return item;
	}
   
}
